package com.quectel.mobile.controller.property;

import com.quectel.core.module.property.dto.PropertyInfoDto;
import com.quectel.core.module.property.service.PropertyInfoService;
import com.quectel.mobile.controller.BaseController;
import com.quectel.util.common.Response;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 物业基础信息
 *
 * @author by bobo
 * @email bobo.yu@quectel.com
 * @date 2021/12/27 下午3:08
 * 物业基础信息
 */
@RestController
@RequestMapping("propertyInfo")
@Tag(name = "PropertyInfoController", description = "物业信息相关api")
public class PropertyInfoController extends BaseController {

    @DubboReference
    private PropertyInfoService propertyInfoService;

    @GetMapping("selectByVillageId")
    @Operation(summary = "根据条件查询物业信息")
    public Response<PropertyInfoDto> list(
            @Parameter(description = "小区 villageId") @RequestParam Long villageId) {
        //查询列表数据
        PropertyInfoDto dto = propertyInfoService.selectCacheByVillageId(villageId);
        return Response.<PropertyInfoDto>ok().wrap(dto);
    }

}
